import request from "@/axios/axios.ts";
import {
    AngleSteelModel,
    Material,
    MaterialFuzzySearch, Transfer,
} from "@/api/inventory/material/type.ts";
enum API1 {
    C = '/inventory/material_crud',
    D = '/inventory/material_fuzzy_search',
    E = '/inventory/angle_steel_model_code',
    F = '/inventory/transfer',
}

// 用于角钢入库的特殊接口
export const req_material_angle_steel_model = (data: AngleSteelModel): Promise<any> => {
    return request.post<any, any>(API1.E, data)
}
// 物料模糊搜索
export const req_material_fuzzy_search = (data: MaterialFuzzySearch): Promise<any> => {
    return request.post<any, any>(API1.D, data)
}
// 物料调拨
export const req_transfer = (data: Transfer): Promise<any> => {
    return request.post<any, any>(API1.F, data)
}
// 物料增删改查
export const req_material_create = (data: Material<'create'>): Promise<any> => {
    return request.post<any, any>(API1.C, data)
}
export const req_material_delete = (data: Material<'delete'>): Promise<any> => {
    return request.post<any, any>(API1.C, data)
}
export const req_material_update = (data: Material<'update'>): Promise<any> => {
    return request.post<any, any>(API1.C, data)
}
export const req_material_read = (data: Material<'read'>): Promise<any> => {
    return request.post<any, any>(API1.C, data)
}